import request from '@/utils/request'

// 获取帖子评论列表
export function getComments(postId) {
  return request({
    url: `/posts/${postId}/comments`,
    method: 'get'
  })
}

// 发布评论
export function publishComment(postId, data) {
  return request({
    url: `/posts/${postId}/comments`,
    method: 'post',
    data
  })
}

// 删除评论
export function deleteComment(postId, id) {
  return request({
    url: `/posts/${postId}/comments/${id}`,
    method: 'delete'
  })
}
